<template>
  <!-- 搜索组件 -->
  <view class="search" :style="{'background-color':bgColor}">
    <view class="my-search-box" :style="{'border-radius':radius + 'rpx'}" @click="searchDetail">
      <uni-icons type="search" size="17"></uni-icons>
      <text class="placeholder">搜索</text>
    </view>
  </view>
</template>

<script>
  export default {
    name: "my-search",
    props: {
      // 背景颜色
      bgColor: {
        type: String,
        default: '#c00000'
      },
      // 圆角尺寸
      radius: {
        type: Number,
        // 单位rpx
        default: 36
      }
    },
    data() {
      return {

      };
    },
    methods: {
      searchDetail() {
        // this.$emit('名字')
        this.$emit('searchClick')
      }
    }
  }
</script>

<style lang="scss">
  .search {
    height: 100rpx;
    padding: 0 20rpx;
    display: flex;
    align-items: center;

    .my-search-box {
      height: 72rpx;
      background-color: #fff;
      width: 100%;
      display: flex;
      justify-content: center;
      align-items: center;

      .placeholder {
        font-size: 30rpx;
        margin-left: 10rpx;
      }
    }
  }
</style>
